pp108 : regExpr Property

regExpr Property


String that specifies the filter that is to be used for validating the field, but in a regular expression format.

Syntax

HTML

<ELEMENT id=elementID fieldType=sType regExpr=sRegExp...>...</ELEMENT>

Scripting

elementID.regExpr [ =sRegExp ]


Parameters

Parameter

Description

sRegExp

String that denotes the regular expression that can be used to validate the data in a field.


Example


The following example shows how theregExprproperty can be used.

//validate definition inside the BODY
<div cordysType="wcp.library.util.Validate" id="validate"></div>
//Restrict the amount field to only have a sign and equal to 4 decimals
<input type="text" fieldType="amount" regExpr="^[-+]?\d+(\.\d{4})+$">
//This ensures that the first letter entered is always an alphabet
<input type="text" fieldType="text" filter="^[A-Za-z]+">

See Also


validate